/*
 * job_generator.h
 *
 *  Created on: 2009-1-7
 *      Author: fanliangliang
 */

#ifndef JOB_GENERATOR_H_
#define JOB_GENERATOR_H_

#include "toxic.h"
#include <vector>

using toxic::Thread;
using std::vector;

// forward declaration
class Compressor;
class Item;
class Time;
class JobArgument;

class JobGenerator : public Thread {
public:
	JobGenerator(Compressor* compressor, const vector<Item*>* items);
	virtual ~JobGenerator();
	virtual void run();

	void stop();

private:
	JobArgument* getJobByTime(const Time& time) const;

private:
	Compressor* compressor_;
	const vector<Item*>* items_;
	volatile bool isRunning_;
};

#endif /* JOB_GENERATOR_H_ */
